<?php
/**
 * Description:
 *
 * @param type $var Description:
 * @return type Description:
 *
 */
class Ip_to_country_model extends Model {
    function __construct() {
        parent::Model();
    }

    function index() {

    }
    /**
     * Description:
     *
     * @param type $var Description:
     * @return type Description: the three code country if the country is greece or cyprus.
     *
     */
    function check_country( $IP_Number) {
        $this->db->select('language');
        $this->db->from('lr_ip-to-country');
        $this->db->where('end >=', $IP_Number);
        $this->db->where('begin <=',$IP_Number );
         $this->db->limit(1);
        $query = $this->db->get();

        if ( $query->num_rows() > 0 ) {
            $row = $query->row_array();
            return $row['language'];
        }
        else return false;

    }
}
